<? require_once('../fun/users.php'); ?>
<?
		$results = array();
	if(isset($_POST['id']))
	{
		$row = $_POST;
		$results = ValidateUser($row);
		if($results === true)
		$results = CreateUser($row);
		if($results === TRUE)
		{
			redirect_to("index.php");
		}
	}
	
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Create Account | &psi; Psychology Database &psi;</title>
<? include ("../inc/required-links.php") ?>
</head>

<body>
<div id="wrapper">
	<div id="l_l"></div> 
    <div id="left">
		<?php include ('../nav/nav.php') ?>
    </div>
    <div id="main">
		<?php include ('../inc/header.php') ?>
        <div id="t_bg"></div>
        <div id="content">
			<div class="otstup">
            	<div id="main_left">
					<div class="corners">
                    	<div class="text">
                <form class="createForm formPost" method="post" action="create.php" style="width:420px;">
                    <div class="modal-header" style="text-align:center;"><h1>Create User</h1></div>
                	<input type="hidden" name="id" id="id" value="" />
                    <div class=" control-group">
                        <label for="FirstName">First Name:</label>
                        <div class="controls">
                            <input type="text" name="FirstName" id="FirstName" value=""
                            class="required <?=isset($results['FirstName']) ? 'error' : '' ?>" />
                            <span class="error"><?=isset($results['FirstName']) ? $results['FirstName'] : '' ?></span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label for="LastName">Last Name:</label>
                        <div class="controls">
                            <input type="text" name="LastName" id="LastName" value=""
                            class="required <?=isset($results['LastName']) ? 'error' : '' ?>" />
                            <span class="error"><?=isset($results['LastName']) ? $results['LastName'] : '' ?></span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label for="Password">Password:</label>
                        <div class="controls">
                            <input type="text" name="Password" id="Password" value=""
                            class="required <?=isset($results['Password']) ? 'error' : '' ?>" />
                            <span class="error"><?=isset($results['Password']) ? $results['Password'] : '' ?></span>
                        </div>
                    </div>
                    <input class="btn btn-mini" style="margin-top:10px;" type="submit" value="Create" />
                </form><br /><a href="http://cs.newpaltz.edu<?=$_GET['returnUrl']?>">Cancel</a>
                        </div>
                    </div>
                </div>
                <div id="right">
					<?php include ('../inc/cat_box1.php') ?>
					<?php include ('../inc/cat_box3.php') ?>
					<?php include ('../inc/cat_box4.php') ?>
					<?php include ('../inc/sn_links.php') ?>
                </div>
        		<div class="clear"></div>
        	</div>
        </div>
        <div class="clear"></div>  
        <div id="foot">
        	<?php include ('../inc/footer.php') ?>
		</div>
		<?php include ('../inc/copywright.php') ?>
        </div>
<div class="clear"></div> 
</div>
</body>
</html>
